package services;

public class WeightService {

	public static double getWeight(double frequency, int totalSizeNode, int sizeNodeCollection, int numberNodeWithWord){		
		return getTFValue(frequency, totalSizeNode) * getIDFValue(sizeNodeCollection, numberNodeWithWord);
	}
	
	private static double getTFValue(double frequency, int totalSizeNode){
		return (frequency/totalSizeNode);
	}
	
	private static double getIDFValue(int sizeNodeCollection, int numberNodeWithWord){
		return Math.log(sizeNodeCollection/numberNodeWithWord);
	}
	
	
}
